<template>
    <van-checkbox-group
        v-model="checked"
        :max="cardAttr?.max"
        shape="square"
    >
    <van-grid
        :class="cardAttr?.goodsCradclass"
        :column-num="cardAttr?.columnNum"
        :gutter="cardAttr?.gutter"
        class="vote_card"
    >
        <van-grid-item
            v-for="(item, index) in voteList"
            :key="index"
        >
            <transition
                appear
                appear-class="card_appear__class"
                appear-to-class="card_appear__to__class"
                appear-active-class="card_appear__active__class"
            >
                <div class="card_body">
                    <van-image :src="item?.img" />
                    <div>
                        <van-checkbox :name="item?.goodsId">{{ item?.name }}</van-checkbox>
                    </div>
<!--                    <div class="name_text">{{ item?.name }}</div>-->
<!--                    <van-button type="primary">主要按钮</van-button>-->
                </div>
            </transition>
        </van-grid-item>
    </van-grid>
    </van-checkbox-group>
</template>
<script setup name="voteCard">
const router = useRouter();
const props = defineProps({
    voteList: {
        type: Array,
        default: () => {
            return [];
        },
    },
    cardAttr: {
        type: Object,
        default: () => {
            return {
                columnNum: 2,
                gutter: 6,
                itemClass: "recommend_item",
                max: 2,
            };
        },
    },
    // selected: {
    //     type: Array,
    //     default: () => {
    //         return [];
    //     },
    // }
});
const checked = ref([]);
</script>
<style lang="less" scoped>
.card_body {
    font-size: 14px;
}
</style>
